//
//  GameObject.cpp
//  SkyFight
//
//  Created by HoangLinh on 7/25/13.
//
//

#include "GameObject.h"

GameObject::GameObject()
{

}

GameObject::~GameObject()
{
    dataDict = NULL;
    handler = NULL;
}

void GameObject::initGameObjectWith(GamePlayScreen *_gameScreen)
{
    handler = _gameScreen;
}

void GameObject::initGameObjectWith(GamePlayScreen *_gameScreen, CCDictionary *_dict)
{
    handler = _gameScreen;
    dataDict = _dict;

#ifdef CCOBJECT_DEBUG
    if (dataDict) {
        CCPrettyPrinter visitor;
        dataDict->acceptVisitor(visitor);
        CCLog("data dict: %s\n", visitor.getResult().c_str());
    }
#endif

}

void GameObject::createSprite()
{

}

void GameObject::changeState(unsigned char _state)
{

}

void GameObject::removeObject()
{
    handler->removeGameObject(this);

#ifdef CCOBJECT_DEBUG
    CCLog("sprite retain: %d\n", sprite->retainCount());
#endif

    if (sprite) {
        sprite->release();
        sprite = NULL;
    }
}
